<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j">
    <body>
        <h:form>
            <h:dataTable value="#{MBDocumentos.lista}" var="Documento" width="70%" id="tabelaArquivos">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.id}" />
                    </f:facet>
                    <h:outputText value="#{Documento.id}" />
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.author_name}" />
                    </f:facet>
                    <h:outputText value="#{Documento.usuario.nome}" />
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.file_name}" />
                    </f:facet>
                    <h:outputText value="#{Documento.urlArquivo}" />

                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.doc_date}" />
                    </f:facet>
                    <h:outputText value="#{Documento.dataInsercao}" />
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.down}" />
                    </f:facet>

                    <h:outputLink value="../uploads/#{Documento.urlArquivo}" >download</h:outputLink>
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="#{msg.delete}" />
                    </f:facet>
                    <h:commandButton value="X" action="#{MBDocumentos.excluirDocumento}" >
                        <f:setPropertyActionListener target="#{MBDocumentos.documento}" value="#{Documento}" />
                    </h:commandButton>
                </h:column>


            </h:dataTable>
        </h:form>
    </body>
</html>

